package com.abe.jmcl.android.retrofit;

import android.os.Bundle;
import android.widget.TextView;

import com.abe.jmcl.R;
import com.abe.jmcl.android.retrofit.contract.CommonContract;
import com.abe.jmcl.android.retrofit.presenter.CommonPresenter;
import com.abe.jmcl.entity.http.test.HttpUserInfoEntity;
import com.abeframe.core.base.MVPBaseActivity;
import com.google.gson.Gson;

import butterknife.BindView;

public class ServiceTestActivity extends MVPBaseActivity<CommonContract.ServiceTestView, CommonPresenter> implements CommonContract.ServiceTestView {
    @BindView(R.id.item_text_01)
    TextView itemText01;

    @Override
    protected CommonPresenter createPresenter() {
        return new CommonPresenter();
    }

    @Override
    protected int getThemeResId() {
        return 0;
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_retrofit_xml;
    }

    @Override
    protected void init(Bundle savedInstanceState) {

    }

    @Override
    protected void initDatas() {
        mPresenter.getData();
    }

    @Override
    public void onGetData(HttpUserInfoEntity infoEntity) {
        itemText01.setText(new Gson().toJson(infoEntity));
    }

    @Override
    public void showMessage(int Type, String message) {

    }

    @Override
    public void onFaild() {

    }

    @Override
    public void onFinish(String type) {

    }

    @Override
    public void onFaild(String type) {

    }
}
